package com.woniu.service.impl;

import com.woniu.adapter.OrderAdapter;
import com.woniu.outlet.dao.OrderPoMapper;
import com.woniu.outlet.po.OrderPo;
import com.woniu.service.OrderService;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrderServicempl implements OrderService {
    @Autowired
    private OrderAdapter orderAdapter;

    @Override
    public List<OrderPo> findOrders() throws Exception {
        List<OrderPo> orderPos = orderAdapter.findOrders();
        return orderPos;
    }

    @Override
    public List<OrderPo> findOrderByOrderNo(String orderNo) throws Exception{
        List<OrderPo> orderPo = orderAdapter.findOrderByOrderNo(orderNo);
        return orderPo;
    }

    @Override
    public List<OrderPo> findOrderById(Long id) throws Exception {
        List<OrderPo> orderPo = orderAdapter.findOrderById(id);
        return orderPo;
    }

    @Override
    public Long findIdByOrderNo(String orderNo) throws Exception {
        return orderAdapter.findIdByOrderNo(orderNo);
    }
}
